package com.example.democlient.network.serverpackets;

import java.nio.ByteBuffer;

import com.example.democlient.network.ServerConnection;
import com.example.democlient.network.packet.ServerPacket;

/**
 * 向服务器发送
 * @author Administrator
 *
 */
public class SM_TASK_CREATE_REQUEST extends ServerPacket
{

	private final int taskFlag;
//	private final int districtId;
//	private final String address;
	private final String telphone;
	private final String remark;
	private String taskAreaName;
//	private final int locFlag;
//	private final long xaxis;
//	private final long yaxis;
	private final int addressId;
	private final String account;
	public SM_TASK_CREATE_REQUEST(String taskAreaName,int taskFlag,int addressId,int districtId,String address ,String telphone,String remark,int locFlag,String account)
	{
		super(0x04);
		this.taskFlag=taskFlag;
		this.addressId = addressId;
//		this.districtId = districtId;
		this.taskAreaName = taskAreaName;
//		this.address=address;
		this.telphone=telphone;
		this.remark=remark;
//		this.locFlag = locFlag;
//		this.xaxis = xaxis;
//		this.yaxis = yaxis;
		this.account = account;
	}

	@Override
	protected void writeImpl(ServerConnection con, ByteBuffer buf)
	{
		writeC(buf,taskFlag);
		//writeD(buf,districtId);
		writeD(buf,addressId);
		//writeS(buf,address);
		writeS(buf,telphone);
		writeS(buf,remark);
		//writeD(buf,locFlag);
		//writeQ(buf,xaxis);
		//writeQ(buf,yaxis);
		writeS(buf,account);
		writeS(buf,taskAreaName);
	}
}
